package com.ruoyi.project.gxgw_modules.common;

/**
 * @author tianpeidong
 * @version 2019.01.18
 * 审核状态
 */
public enum CheckState {

    CHECKING(0, "未审核"),

    ACCESS(1, "审核通过"),

    DENY(2, "审核不通过"),

    NULL(-1, "")


    ;
    private final int code;
    private final String description;

    CheckState(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static CheckState matchState(int stateCode) {
        for (CheckState state : CheckState.values()) {
            if (state.getCode() == stateCode) {
                return state;
            }
        }
        return CheckState.NULL;
    }

}
